package com.sntk.organauthomanager.domain.model;

import com.sntk.organauthomanager.infrastructure.exception.DataNoLegalException;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

/**
 * @作者：wgchao
 * @时间：20:37 2020/7/18 0018
 * @用途：
 **/
@Data
@Getter
@Setter(AccessLevel.PROTECTED)
public class RoleIdentify extends ValueObject {
    //机构编号
    private String institutionNumber;

    //角色码
    private String roleCode;

    public RoleIdentify(String institutionNumber, String roleCode) {
        if(StringUtils.isEmpty(roleCode)){
            throw new DataNoLegalException("角色码不能为空");
        }
        this.institutionNumber = institutionNumber;
        this.roleCode = roleCode;
    }
}
